
import Vue from 'vue';
import Vuex from 'vuex';
// import Polyfill from 'babel-polyfill';

// import product from './modules/product'
// import order from './modules/order'
import stroke from './modules/stroke'
import guider from './modules/guider'
import group from './modules/group'
import travelgency from './modules/travelgency'
import clients from './modules/clients'
// import teletext from './modules/teletext'
// import discover from './modules/discover'
// import account from './modules/account'
// import settlement from './modules/settlement'
// import volunteer from './modules/volunteer'
// import custom from './modules/custom'
// import message from './modules/message'
// import contact from './modules/contact'
import journal from './modules/journal'

import product from './modules/product'
Vue.use(Vuex);
// Vue.use(Polyfill);

let http='https://www.wiicent.com:8001';
// var http='http://192.168.11.188:8001';
const state = {
    pageNum:50,//table每页多少条
    thisMOdule:'module',//leftNav切换时显示对应的模块tab
    interface:{
        // login:http+'/index/login',//登录
        login:`${http}/index/otherLogin`,//后台管理系统登录
        // 产品管理
        // travelProHome:http+'/wbTravelPro/wbTravelProIndex',//产品管理列表
        // travelProHomeRevise:http+'/inventory/inventoryEdit',//产品管理列表数据修改
        // theNewProduct:http+'/lxGentuan/lxGentuanAdd',//新建产品
        // fileUpload:http+'/fileUpload/fileUpload',//新建产品图片
        // theNewProductDay:http+'/lxScheduleDay/lxScheduleDayList',//新建产品获取行程
        // theNewProductDetails:http+'/lxScheduleDay/setLxScheduleDay',//新建产品获取行程提交
        // wbTravelProView:http+'/wbTravelPro/wbTravelProView',//获取产品编辑修改
        // lxGentuanEdit:http+'/lxGentuan/lxGentuanEdit',//产品编辑修改提交
        // setShowStatus:http+'/inventory/setShowStatus',//上下架
        // lxBaocheAdd:http+'/lxBaoche/lxBaocheAdd',//新建包车服务产品
        // // lxProBaocheView:http+'/lxBaoche/lxProBaocheView',//获取编辑包车服务产品
        // lxBaocheEdit:http+'/lxBaoche/lxBaocheEdit',//编辑包车服务产品
        // lxXiangdaoAdd:http+'/lxXiangdao/lxXiangdaoAdd',//新建向导服务产品
        // // lxProXiangdaoView:http+'/lxXiangdao/lxProXiangdaoView',//获取编辑向导服务产品
        // lxXiangdaoEdit:http+'/lxXiangdao/lxXiangdaoEdit',//编辑向导服务产品
        // lxProGentuanAdd:http+'/lxGentuan/lxProGentuanAdd',//添加行程
        // lxTravelProDel:http+'/lxTravelPro/lxTravelProDel',//删除库存接口
        //
        // // 订单管理
        // Orderlist:http+'/wbOrderTravel/wbOrderTravelIndex',//订单管理列表
        // lxOrderTravelStatus:http+'/lxOrderTravel/lxOrderTravelStatus',//更新订单状态
        // wbOrderTravelView:http+'/wbOrderTravel/wbOrderTravelView',//订单详情
        // xchRenyuanIndex:http+'/xchRenyuan/xchRenyuanIndex', // 订单人员
        // // 图文管理
        // Contentlist:http+'/wbMatch/wbMatch',//图文管理列表
        // talkAdd:http+'/talk/talkAdd',//图文管理新建
        // talkView:http+'/talk/talkView', //图文管理详情
        // talkEdit:http+'/talk/talkEdit',//图文管理修改
        // // 发现管理
        // baikeAdd:http+'/baike/baikeAdd', //新增
        // baikeView:http+'/baike/baikeView', //详情
        // baikeEdit:http+'/baike/baikeEdit', //修改
        // // 收支明细
        // WalletLoglist:http+'/wbWalletLog/wbWalletLogIndex',//收支明细列表
        // BkWalletLogView:http+'/bkWalletLog/bkWalletLogView',//收支明细详情
        // 行程管理
        // xchBaseList:http+'/wbXchBase/wbXchBaseIndex',//行程管理列表
        // lxProScheduleStatus:http+'/lxProSchedule/lxProScheduleStatus', //更新行程状态
        renyuanStatus: `${http}/wbXchRenyuan/setWbXchRenyuanStatus`, //成员入团、加入行程接口
        xchBaseList:`${http}/wbXchBaseOther/wbXchBaseOtherIndex`,//行程管理列表
        ptXchBaseGetPosition:`${http}/ptXchBase/ptXchBaseGetPosition`, //查看位置
        wbXchBaseAdd:`${http}/wbXchBase/wbXchBaseAdd`, //新建行程
        xchBaseView:`${http}/xchBase/xchBaseView`,//行程编辑获取
        // xchBaseView:http+'/wbXchBaseOther/wbXchBaseOtherDetailData',//行程编辑获取
        // setXchBase:http+'/xchBase/setXchBase',//行程编辑
        setXchBase:`${http}/wbXchBaseOther/wbXchBaseOtherSet`,//行程编辑
        setXchScheduleDay:`${http}/xchScheduleDay/setXchScheduleDay`,//日程修改
        xchScheduleDayList:`${http}/xchScheduleDay/xchScheduleDayList`,//获取日程
        xchBaseStatus:`${http}/xchBase/xchBaseStatus`,//更新行程状态
        setXchMsg:`${http}/xchBase/setXchMsg`,//公告通知
        xchChutuanView:`${http}/xchChutuan/xchChutuanView`, //出团通知获取
        setXchChutuan:`${http}/xchChutuan/setXchChutuan`, //出团通知修改
        wbXchRenyuanList:`${http}/wbXchRenyuan/wbXchRenyuanList`,//成员名单表单

        setXchRenyuan:`${http}/xchRenyuan/setXchRenyuan`,//成员增加/修改
        xchRenyuanView:`${http}/xchRenyuan/xchRenyuanView`,//成员详情
        UploadRenyuan:`${http}/wbExcel/wbUploadRenyuan`,//导入成员
        DelRenyuan:`${http}/wbDel/wbDelRenyuan`, //人员删除

        wbXchBaseDetailData:`${http}/wbXchBase/wbXchBaseDetailData`, //获取复制行程
        wbXchBaseCopy:`${http}/wbXchBase/wbXchBaseCopy`,//提交复制行程
        //志愿者
        // wbVolunteer:http+'/wbMatch/wbVolunteer',//志愿者

        //定制管理

        //消息管理
        // wbAboutMeIndex:http+'/wbAboutMe/wbAboutMeIndex',//我的消息列表
        // wbAboutMeXchIndex:http+'/wbAboutMe/wbAboutMeXchIndex',//行程通知首页
        // wbAboutMeXchList:http+'/wbAboutMe/wbAboutMeXchList', //行程通知列表
        // wbAboutMeOrderList:http+'/wbAboutMe/wbAboutMeOrderList',//订单通知列表
        // wbAboutMeWalletList:http+'/wbAboutMe/wbAboutMeWalletList',//钱包通知列表
        // wbAboutMeSystemList:http+'/wbAboutMe/wbAboutMeSystemList',//系统通知列表
        // xchMsgList:http+'/xchMessage/xchMsgList',//指定对象普通消息
        // setMsgText:http+'/xchMessage/setMsgText',//发送文字消息

        // 联系人
        // customerFriendsList:http+'/customer/customerFriendsList',//	联系人列表
        // wbCustomerInfo:http+'/wbCustomer/wbCustomerInfo',//web端查看用户信息接口

        //日志
        BlogPingtaiIndex:`${http}/wbXchBlog/wbXchBlogHoutaiIndex`, //日志列表
        ptXchBlogIndex:`${http}/ptXchBlog/ptXchBlogIndex`, //日志详情
        BlogExportAuthorToWord:`${http}/xchBlog/xchBlogExportAuthorToWord`,//导出日志

        // 地区
        areaList:`${http}/area/areaList`,//地区联动
        // 删除
        DelById:`${http}/bkDel/bkDelById`,

        // 导游管理
        guiderList: `${http}/wbGuide/getWbGuideList`, //导游列表
        addGuider: `${http}/wbGuide/setWbGuide`, //导游设置信息
        deleteGuider: `${http}/wbGuide/cxDelOneById`, //删除导游
        guiderView: `${http}/wbGuide/wbGuideView`, //导游详情
        bindGuider: `${http}/wbGuide/wbGuideSetBind`, //导游绑定/解绑接口
        searchPhone: `${http}/customer/customerSearchByPhone`,

      //派团管理
        groupList: `${http}/wbPaituan/getWbPaituanList`, //派团列表
        addGroup: `${http}/wbPaituan/setWbPaituan`, //派团
        deleGroup: `${http}/wbPaituan/wbDelOneById`,
        groupView: `${http}/wbPaituan/wbPaituanView`,
        deleFile: `${http}/wbPaituan/wbDelFile`,

      //旅行社
        travelGencyList: `${http}/wbTravelGency/getWbTravelGencyList`, //
        addtravelGency: `${http}/wbTravelGency/setWbTravelGency`, //
        deleTravelgency: `${http}/wbTravelGency/cxDelOneById`,
        travelgencyView: `${http}/wbTravelGency/wbTravelGencyView`,

      // 客户资料
        customerList: `${http}/wbKefuData/getWbKefuDataList`,
        addCustomer: `${http}/wbKefuData/setWbKefuData`,
        customerView: `${http}/wbKefuData/wbKefuDataView`,
        deleCustomer: `${http}/wbKefuData/cxDelOneById`
    }
};


export default new Vuex.Store({
    state,
    modules: {
        // product,
        // order,
        stroke,
        guider,
        group,
        travelgency,
        clients,
        // teletext,
        // discover,
        // account,
        // settlement,
        // volunteer,
        // custom,
        // message,
        // contact,
        journal,
        product
    },
});




// // 需要改变的state   转变、设置值的地方
// const mutations = { //
//     // 初始化 state
//     INIT_STORE(state, data) {
//         state.thisMOdule = data.thisMOdule;//leftnav 当前处于哪个模块
//         state.tabNav = data.tabNav,// 顶部tab
//         // state.tabNav.tabNavList = data.tabNav.tabNavList,
//         // state.tabNav.activeTabNav = data.tabNav.activeTabNav,

//         // 测试
//         state.count.num = data.count.num;
//     },
//     // tabNav新建一个tab
//     // NEW_TAB(state,{moduleName,ele}) {
//     //     var newTab = {
//     //         'title':'新建'+moduleName,
//     //         'delShow':true,
//     //         'show':true,//是否显示高亮  true of false
//     //         id:+new Date(),
//     //         eleLabel:ele
//     //     };
//     //     state.tabNav.newTab = newTab;
//     //     // state.tabNav.tabNavList.push(newTabNav);//增加到tabNavList
//     //     // state.tabNav.activeTabNav = newTabNav;//新增的tab高亮
//     //     console.log(state.tabNav)
//     // },
//     // 删除一个tab
//     DELETE_TABNAV(state) {
//         state.tabNav.tabNavList.$remove(state.tabNav.activeTabNav);
//         state.tabNav.activeTabNav = state.tabNav.tabNavList[0];//删除某一一个，高亮显示第一个
//     },
//     // 切换tab的高亮
//     TOGGLE_FAVORITE(state) {
//         if(!state.tabNav.activeTabNav.active){
//             state.tabNav.activeTabNav.active = !state.tabNav.activeTabNav.active;
//         }else{
//             state.tabNav.activeTabNav.active = state.tabNav.activeTabNav.active;
//         }
//     },
//     // 进入页面 设置默认高亮显示的tab 为第一个
//     SET_ACTIVE_tab(state, tab) {
//         state.tabNav.activeTabNav = tab;
//     },

//     //   测试  加法
//     ADD_NUM(state,n){
//         state.count.num +=n;
//         console.log(state.count.num)
//     }
// };
